/**
 * 
 */
package diary;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JTextArea;

/**
 * @author haiyuzha
 *
 */
public class MouseHandler extends MouseAdapter {
	private JTextArea ta;
	/**
	 * 
	 */
	public MouseHandler(JTextArea arg) {
		ta = arg;
	}
	
	/* (non-Javadoc)
	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
	 */
	@Override
	public void mouseClicked(MouseEvent e) {
		System.out.printf("Clicked %s: %d\n", e.getClass().getName(), e.getClickCount());
		ta.append(new String().format("Clicked %s: %d\n", e.getClass().getName(), e.getClickCount()));
	}

}
